<?php foreach($this->product->getColorApplications() AS $ca): ?>
	<?php $colors = $ca->getColors() ?>
	<?php if($colors->count() == 2): ?>
	<a id="colorid-<?php echo $ca->getId() ?>" href="<?php echo $this->requestUri() ?>">
		<span class="swatch two-colors">
			<img width="18" height="18" alt="" style="display: none;" src="sherpa/img/color-x.gif"/>
			<span class="inner-border">
				<?php foreach($colors AS $i=>$color): ?>
				<span class="color<?php echo ($i+1) ?>" style="background-color: #<?php echo $color->getRgbHex() ?>">&nbsp;</span>
				<?php endforeach; ?>
			</span>
		</span>
	</a>
	<?php elseif($colors->count() == 1): ?>
	<a id="colorid-<?php echo $ca->getId() ?>" href="<?php echo $this->requestUri() ?>">
		<span class="swatch one-color">
			<img width="18" height="18" alt="" style="display: none;" src="sherpa/img/color-x.gif"/>
			<span class="inner-border" style="background-color: #<?php echo $colors->current()->getRgbHex() ?>">&nbsp;</span>
		</span>
	</a>
	<?php endif; ?>
<?php endforeach; ?>